import axios from 'axios'
import { Toast } from 'vant'
import router from '../router'

// axios.defaults.baseURL = process.env.NODE_ENV == 'development' ? 'http://backend-api-01.newbee.ltd/api/v1' : 'http://backend-api-01.newbee.ltd/api/v1'
// axios.defaults.withCredentials = true
// axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
// axios.defaults.headers['token'] = localStorage.getItem('token') || ''
axios.defaults.headers.post['Content-Type'] = 'application/json'
// axios.defaults.headers.post['Authorization-Type'] = 'jwt ' + this.$cookies.get('token')

axios.interceptors.response.use(res => {
  return res.data
})

export default axios
